<?php

use yii\helpers\Url;

return [
    [
        'class' => 'kartik\grid\CheckboxColumn',
        'width' => '20px',
    ],
    [
        'class' => 'kartik\grid\SerialColumn',
        'width' => '30px',
    ],
    // [
    // 'class'=>'\kartik\grid\DataColumn',
    // 'attribute'=>'id',
    // ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'mobile',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'idcard',
    ],
    [
        'attribute' => 'created_at',
        'format' => ['date', 'php:Y-m-d H:i:s'],
        'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE,
        'filterWidgetOptions' => [
            'model' => $searchModel,
            'attribute' => 'created_at',
            'presetDropdown' => TRUE,
            'convertFormat' => true,
            'pluginOptions' => [
                'format' => 'Y-m-d',
                'opens' => 'left',
                'locale' => [
                    'cancelLabel' => 'Clear',
                    'format' => 'Y-m-d',
                ],
            ]
        ],
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'ret_code',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'score_id',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'err_msg',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'reason',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'risk_level',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'other_data',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'resp_data',
    ],
    [
        'class' => '\kartik\grid\DataColumn',
        'attribute' => 'import_type',
    ],
    [
        'class' => 'kartik\grid\ActionColumn',
        'dropdown' => false,
        'vAlign' => 'middle',
        'urlCreator' => function ($action, $model, $key, $index) {
            return Url::to([$action, 'id' => $key]);
        },
        'viewOptions' => ['role' => 'modal-remote', 'title' => 'View', 'data-toggle' => 'tooltip'],
        'updateOptions' => ['role' => 'modal-remote', 'title' => 'Update', 'data-toggle' => 'tooltip'],
        'deleteOptions' => ['role' => 'modal-remote', 'title' => 'Delete',
            'data-confirm' => false, 'data-method' => false,// for overide yii data api
            'data-request-method' => 'post',
            'data-toggle' => 'tooltip',
            'data-confirm-title' => 'Are you sure?',
            'data-confirm-message' => 'Are you sure want to delete this item'],
    ],

];   